
#include <utility>

#include "utils.h"

bool utils::Stricmp(const std::string& f, const std::string& s)
{
  return std::equal(f.begin(),
                    f.end(),
                    s.begin(),
                    [](char c1, char c2) -> bool {
                      return std::toupper(c1) == std::toupper(c2);
                    });
}

void utils::Assertnnull(void* p)
{
  utils::Assertnnull(p, "空指针异常");
}

void utils::Assertnnull(void* p, std::string msg)
{
  if (!p)
    throw utils::NullptrException(std::move(msg));
}
